<?php

namespace App\Http\Requests\Setting;

use App\Http\Requests\FormRequest;

class PermissionStoreRequest extends FormRequest
{
    public function rules(): array
    {
        return [
            'pid' => 'required|integer',
            'name' => 'required|string|max:20',
            'sort' => 'nullable|integer',

            'permissions' => 'nullable|array',
            'permissions.*.method' => 'required',
            'permissions.*.name' => 'required',
            'permissions.*.slug' => 'required',
            'permissions.*.uri' => 'required',
        ];
    }
}
